﻿using AutoMapper;
using SmartCity.ProcessEngine.Api.Write.Application.Command.EventHandling;
using SmartCity.ProcessEngine.Api.Write.Application.Command.Form;
using SmartCity.ProcessEngine.Api.Write.Application.Command.FormCategory;
using SmartCity.ProcessEngine.Api.Write.Application.Command.Node;
using SmartCity.ProcessEngine.Api.Write.Dtos;
using SmartCity.ProcessEngine.Domain.Entities;

namespace SmartCity.ProcessEngine.Api.Write
{
    public class PEMapper:Profile
    {
        public PEMapper()
        {
            //映射
            CreateMap<FormCategoryModel, CreateFormCategoryCommand>().ReverseMap();
            CreateMap<FormCategoryModel, UpdateFormCategoryCommand>().ReverseMap();
            CreateMap<FormModel, CreateFormCommand>().ReverseMap();
            CreateMap<FormModel, UpdateFormCommand>().ReverseMap();
            CreateMap<CreateFormFieldDTO,FormFieldModel>().ReverseMap();  //批量循环转换,把list里的dto,转成FormFieldModel  // FormFieldModel model = mapper.Map<FormFieldModel>(dto);   //把每一个dto转成model
            CreateMap<FormNodeConfigModel, CreateNodeCfgDto>().ReverseMap();  //批量循环转换,把list里的dto,转成FormNodeConfigModel

            CreateMap<CreateNodeCommand, NodeModel>().ReverseMap();
            CreateMap<CreateInstanceCommand, InstanceModel>().ReverseMap();
        }
    }
}
